<script>
  var minimun = function (nums) {
    let ans = 0;
    let min = nums[nums.length - 1];
    for (let i = nums.length - 2; i >= 0; i--) {
      if (nums[i] > min) {
        let cnt = Math.ceil(nums[i] / min); // 至少要拆成几个数字，才能保证他们小于等于 min
        ans += cnt - 1; //累加操作次数
        min = Math.floor(nums[i] / cnt); // 更新 min 为本轮拆分后最小的数字
      } else {
        min = nums[i]
      }
    }
    return ans
  }
  console.log(minimun(nums = [3, 9, 3]))
</script>